<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 遍历数组元素,找出符合你需要的
        var arr = [1, 22, 3, 47, 5, 16, 7, 331, 9, 10];
        // 找出 并打印所有的  偶数
        // 查找元素 需要用到 下标
        // 遍历下标 0  --- length-1

        for (var i = 0; i < arr.length; i++) {
            // console.log(arr[i]);
            if (arr[i] % 2 === 0) {
                console.log(arr[i]);
            }
        }
    </script>
</body>

</html>